#include<iostream>
template<class T>
class unique_ptr
{
  public:
    unique_ptr(T*ptr):_ptr(ptr)
    {}
    unique_ptr(unique_ptr&&other):_ptr(other._ptr)
    {
      other._ptr = nullptr;
    }
    unique_ptr & operator=(unique_ptr&&other)
    {
      if(other._ptr!=_ptr)
      {
        delete _ptr;
        _ptr = other._ptr;
        other._ptr = nullptr;
      }
      return *this;
    }
    ~unique_ptr()
    {
      delete _ptr;
    }
    

    unique_ptr(const unique_ptr &) =delete;
    unique_ptr& operator=(const unique_ptr&)=delete;
  private:
    T * _ptr;
};